package com.eportal.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.eportal.base.BaseDAO;
import com.eportal.domain.UserScoreLog;
import com.eportal.service.UserScoreLogService;
import com.framework.jqgrid.JqGridPager;

@Service("userScoreLogService")
public class UserScoreLogServiceImpl implements UserScoreLogService{
	
	@Resource(name="dao")
	private BaseDAO dao;

	@Override
	public UserScoreLog get(Long sid){
		UserScoreLog userScoreLog = (UserScoreLog)dao.getById(UserScoreLog.class, sid);
		return userScoreLog;
	}
	
	@Override
	public List<Map<String, Object>> list(JqGridPager jqGridPager) {
		 String sql = "select t.sid,t.userId,TO_CHAR (t.cTime,'yyyy-mm-dd HH24:mi:ss') as cTime,s.mName,r.incScore "
		 		+ " from t04_user_score_log t"
		 		+ " left join sysmenu s on t.mUrl= s.mUrl"
		 		+ " left join sys_score_rule r on r.sid=t.score_rule_id"; 
	     return dao.query(sql, jqGridPager);
	}
	
	
	
}
